import request from '@/utils/request'
// import qs from 'qs'

// 问卷列表
export function getSurveysList(params) {
  return request({
    url: '/surveys/findList',
    method: 'get',
    params
  })
}

// 问卷添加
export function addSurveys(params) {
  return request({
    url: '/surveys/addSurveys',
    method: 'post',
    params
  })
}

// 问卷编辑
export function editSurveys(params) {
  return request({
    url: '/surveys/updateSurveys',
    method: 'post',
    params
  })
}

// 删除问卷
export function removeSurveys(params) {
  return request({
    url: '/surveys/deleteSurveys',
    method: 'get',
    params
  })
}

// 添加问卷题目
export function addSurveysQuestions(data) {
  // const postData = qs.stringify(data)
  return request({
    url: '/surveys/addQuestionOptions',
    method: 'post',
    data
  })
}

// 获取问卷题目
export function getSurveysQuestions(params) {
  return request({
    url: '/surveys/findQuestionnaireList',
    method: 'get',
    params
  })
}

// 获取所有问卷
export function getAllSurveys(params) {
  return request({
    url: '/surveys/findAllSurveys',
    method: 'get',
    params
  })
}

// 获取会议问卷
export function getMeetingSurveys(params) {
  return request({
    url: '/surveys/findSurveysMeeting',
    method: 'get',
    params
  })
}

// 添加会议问卷
export function addMeetingSurveys(params) {
  return request({
    url: '/surveys/addMeetingSurveys',
    method: 'get',
    params
  })
}

// 移除会议问卷
export function removeMeetingSurveys(params) {
  return request({
    url: '/surveys/deleteMeetingSurveys',
    method: 'get',
    params
  })
}

// 添加会议互动
export function addMeetingVotes(params) {
  return request({
    url: '/surveys/addMeetingSurveysByInteractive',
    method: 'get',
    params
  })
}

// 获取会议小纸条
export function getMeetingNotes(params) {
  return request({
    url: '/hospWechatAcctiveMessageLog/findList',
    method: 'get',
    params
  })
}

// 会议小纸条开关
export function switchMeetingNotes(data) {
  return request({
    url: '/hospWechatAcctiveMessageLog/update',
    method: 'post',
    data
  })
}

// 编辑会议调研上线状态
export function updateMeetingSurveysOnline(params) {
  return request({
    url: '/surveys/updateMeetingSurveysByOnline',
    method: 'get',
    params
  })
}

// 编辑会议调研可重复答题
export function updateMeetingSurveysRepeat(params) {
  return request({
    url: '/surveys/updateMeetingSurveysByRepeat',
    method: 'get',
    params
  })
}

// 发送会议调研
export function pushMeetingSurveys(params) {
  return request({
    url: '/meeting/surveyMeeting',
    method: 'post',
    params
  })
}

// 获取会议调研记录
export function getMeetingSurveysLog(params) {
  return request({
    url: '/surveys/exportMeetingLog',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获取普通调研记录
export function getSurveysLog(params) {
  return request({
    url: '/surveys/exportPersonageLog',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
